import cv2
import numpy as np

girl = cv2.imread("../asset/girl.jpeg")
h, w, ch = girl.shape
# 能实现图片倾斜
src = np.float32([[400, 300], [800, 300], [400, 1000]])
dst = np.float32([[200, 400], [600, 500], [150, 1100]])
M = cv2.getAffineTransform(src, dst)
new_img = cv2.warpAffine(girl, M, (w, h))
while True:
    cv2.imshow('new_img', new_img)
    cv2.imshow('girl', girl)
    key = cv2.waitKey(10)
    if key & 0xFF == ord('q'):
        break

cv2.destroyAllWindows()
